/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pardal.core;

import java.util.ArrayList;

/**
 *
 * @author Valdigleis
 */
public class Node {
    
    private String label;
    
    private String father;
    
    private ArrayList<String> sons;
    
    private int level;
    
    public final String NO_FATHER = "NO";

    public Node(String label) {
        this.label = label;
        this.sons = new ArrayList<>();
        calcLevel();
    }
    
    private void calcLevel(){
        String test = ".|";
        int cont = 0;
        for(int i = 0; i < this.label.length(); i++){
            if(this.label.charAt(i) == test.charAt(0) || this.label.charAt(i) == test.charAt(1)){
                cont++;
            }
        }
        setLevel(cont);
    }
   
    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getFather() {
        return father;
    }

    public void setFather(String father) {
        this.father = father;
    }

    public ArrayList<String> getSons() {
        return sons;
    }

    public void setSons(ArrayList<String> sons) {
        this.sons = sons;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
    
    
}
